package com.ch.home.testMapper;

import com.ch.home.bean.Source;
import com.ch.home.mapper.sourceMapper.SourceMapper;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;

/**
 * Created by CHEN on 2019/8/26.
 */
@RunWith(SpringRunner.class)
@SpringBootTest
public class testSourceMapper {


    @Autowired
    SourceMapper sourceMapper;
//    int addSource(Source source);
//
//    int updateSource(Source source);
//
//    LinkedList<Source> getSourceByCondition(Source source);

    @Test
    public void testAddSource(){
        System.out.println(sourceMapper.addSource(new Source(null,1,"http://www.aliyouth.cn/repository/Image/CodeResource.png","http://www.aliyouth.cn/repository/Image/CodeResource.png",5)) );

    }

    @Test
    public void testUpdate(){
        System.out.println(sourceMapper.updateSource(new Source(2,null,"http://www.baidu.com","http://www.baidu.com",null)) );
    }

    @Test
    public  void tesGetSourceByCondition(){
        System.out.println(sourceMapper.getSourceByCondition(new Source(11,null,null,null,null)) );


        System.out.println("-------------------------------------------------" );
        System.out.println(sourceMapper.getSourceByCondition(new Source(null,1,null,null,1)) );
    }


}
